package com.example.base_mvvm.net;

import com.example.base_mvvm.base.view.GiftEntity;
import com.example.base_mvvm.entity.BannerEntity;
import com.example.base_mvvm.entity.CommentEntity;
import com.example.base_mvvm.entity.FollowEntity;
import com.example.base_mvvm.entity.HomeVideoEntity;
import com.example.base_mvvm.entity.LikeEntity;
import com.example.base_mvvm.entity.LoginEntity;
import com.example.base_mvvm.entity.PushEntity;
import com.example.base_mvvm.entity.RegisterEntity;
import com.example.base_mvvm.entity.StopPushEntity;
import com.example.base_mvvm.entity.VideoEntity;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface ApiService {
    @POST(Const.LOGIN_URL)
    Observable<LoginEntity>login(@Body RequestBody body);

    @POST(Const.REGISTER_URL)
    Observable<RegisterEntity>register(@Body RequestBody body);

    @GET(Const.BANNER)
    Observable<BannerEntity>banner();

    @POST(Const.LIKE)
    Observable<LikeEntity>like(@Query(Const.VIDEOID) int id);
    @POST(Const.DISLIKE)
    Observable<LikeEntity> disLike(@Query(Const.VIDEOID) int id);
    @GET(Const.VIDEO)
    Observable<HomeVideoEntity> homeVideo(@Query(Const.PAGE) int currentPage,
                                          @Query(Const.SIZE) int pageSize);
    @GET(Const.VIDEO)
    Observable<VideoEntity> video(@Query(Const.PAGE) int currentPage,
                                  @Query(Const.SIZE) int pageSize);

    @POST(Const.FOLLOW_URL)
    Observable<FollowEntity> follow(@Body RequestBody body);

    @POST(Const.NO_FOLLOW)
    Observable<FollowEntity> noFollow(@Body RequestBody body);

    @GET(Const.GET_GIFT)
    Observable<GiftEntity> getGift();

    @POST(Const.PUT_COMMENT)
    Observable<CommentEntity> put_comment(@Body RequestBody body);

    @GET(Const.GET_COMMENT)
    Observable<CommentEntity> get_comment(@Query(Const.VIDEOID) int videoId);

    @POST(Const.PUSH_URL)
    Observable<PushEntity> startLive(@Body RequestBody body);

    @POST(Const.STOP_PUSH_URL)
    Observable<StopPushEntity> stopLive();

}
